home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / FONT_UTL / FNTCTL / FONAPP.PAS < prev    next >
Pascal/Delphi Source File  |  1995-03-04  |  2KB  |  64 lines

  1. program FontApp;
  2.  
  3. {---------------------------------------------------------------------
  4. Example application for the custom control Font (FntCtls.DLL) of
  5. the SMWCC 2.0 Custom Control Pack
  6.  
  7. Copyright (C) by Sebastian Modersohn
  8.  
  9. Note: This code file isn't documented into detail. If you have
  10.       questions to *THIS* code file or want to know some details
  11.       please contact me via CompuServe, ID 100340,1474.
  12. ---------------------------------------------------------------------}
  13.  
  14. {$IFNDEF AUTOLOAD}
  15.  
  16.   You HAVE to compile this program with the global defined symbol "AUTOLOAD" !
  17.   This demonstrates the autoloading feature of the import unit Font!
  18. {$ENDIF}
  19.  
  20. {$R FontApp}
  21.  
  22. uses WinTypes, WinProcs, WinDos, OWindows, ODialogs, Strings,
  23.      {the interface unit (only for autoloading the DLL)
  24.       and its constant unit}
  25.      Font, FntCtlCo;
  26.  
  27. type
  28.   {main window: No object has to be initialized!;
  29.    this object is only necessary for the help-call}
  30.   PFontWindow = ^TFontWindow;
  31.   TFontWindow = object(TDlgWindow)
  32.     procedure Help(var Msg: TMessage);
  33.       virtual id_First + 998;
  34.   end;
  35.  
  36. {App that initializes the main window}
  37.   PFontApp = ^TFontApp;
  38.   TFontApp = object(TApplication)
  39.     procedure InitMainWindow; virtual;
  40.   end;
  41.  
  42.  
  43. { TFontWindow }
  44.  
  45. procedure TFontWindow.Help(var Msg: TMessage);
  46. begin
  47.   WinHelp(HWindow, HelpFile, Help_Context, 100);
  48. end;
  49.  
  50. { TFontApp }
  51.  
  52. procedure TFontApp.InitMainWindow;
  53. begin
  54.   MainWindow := New(PFontWindow, Init(nil, 'dlg_main'));
  55. end;
  56.  
  57. var App: TFontApp;
  58.  
  59. begin
  60.   App.Init('Font Demo');
  61.   App.Run;
  62.   App.Done;
  63. end.
  64.